<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Echarts</title>
  <script src="js/echarts.js"></script>
</head>
<body>
  <div style="width: 600px; height: 400px ;background: #F8F8FF"></div>
  <script>

    let mCharts = echarts.init(document.querySelector('div'))
    let xDataArr = ['张建','梁瑾','高颜领','王晓明','康凯','戚贤','王俊星','贾槐坚','申亚辉','薄浩丹']
    let yDataArr = [209,208,218,116,228,414,177,328,280.5,211]
    let option = {
     title: {  //配置标题组件，包含主标题和副标题
                text: '教学支持数据',
            left: "center",  //设置组件离容器左侧的距离
                top: "top",  //设置组件离容器上侧的距离
                textStyle: {   //设置标题的颜色
               color: 'red'
               }
            },
      xAxis: {
        type: 'category',
        data: xDataArr
      },
      yAxis: {
        type: 'value'
      },
      series: [
        {
          name: '9-10月课时:',
          type: 'bar',
          data: yDataArr,
          markPoint: {
            data: [
              {
                type: 'max',
                name: '最大值'
              }, {
                type: 'min',
                name: '最小值'
              }
            ]
          },
          markLine: {
            data: [
              {
                type: 'average',
                name: '平均值'

              }
            ]
          },

          label: {
            show: true,
            rotate: -30
          },
          barWidth: '40%'
        }
      ]
    }
    mCharts.setOption(option)
  </script>
</body>
</html>